package cn.iocoder.an.module.business.dal.mysql.equipmentcheckrecord;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.equipmentcheckrecord.EquipmentCheckRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.equipmentcheckrecord.vo.*;

/**
 * 点检记录 Mapper
 *
 * @author zzy
 */
@Mapper
public interface EquipmentCheckRecordMapper extends BaseMapperX<EquipmentCheckRecordDO> {

    default PageResult<EquipmentCheckRecordDO> selectPage(EquipmentCheckRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EquipmentCheckRecordDO>()
                .inIfPresent(EquipmentCheckRecordDO::getEquipmentId, reqVO.getEquipmentIdList())
                .likeIfPresent(EquipmentCheckRecordDO::getCheckUserName, reqVO.getCheckUserName())
                .betweenIfPresent(EquipmentCheckRecordDO::getCheckTime, reqVO.getCheckTime())
                .eqIfPresent(EquipmentCheckRecordDO::getCheckResult, reqVO.getCheckResult())
                .orderByDesc(EquipmentCheckRecordDO::getId));
    }

}